package com.cskaoyan.exception;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author stone
 * @date 2022/06/29 10:04
 */
@RestControllerAdvice
public class CustomControllerAdvice {


    @ExceptionHandler({MarketValidationException.class})
    public BaseRespVo invalidParameter(MarketValidationException exception) {
        return BaseRespVo.invalidParameter(exception.getMessage());
    }

    @ExceptionHandler({ArithmeticException.class})
    public BaseRespVo invalidParameter1(ArithmeticException exception) {
        return BaseRespVo.invalidParameter(exception.getMessage());
    }
}
